import request from "@/utils/request";

export function login(userPhone, password, timestamp, code) {
  return request({
    url: "/oauth/token",
    method: "post",
    data: {
      userPhone,
      password,
      code,
      timestamp
    }
  });
}

export function getInfo() {
  return request({
    url: "/oauth/getUserInfo",
    method: "get"
  });
}

export function logout() {
  return request({
    url: "/oauth/logout",
    method: "post"
  });
}

export function getAuthCode(timestamp) {
  return request({
    url: "/admin/sysUser/getCaptcha?timestamp=" + timestamp,
    method: "get"
  });
}

export function getRouters() {
  return request({
    url: "/oauth/getRouters",
    method: "get"
  });
}
export function weChatLoginMobile() {
  return request({
    url: "/weChat/weChatLoginMobile",
    method: "get"
  });
}
